package com.ls.superclass;

public class B extends A{
	private static A instance;
	public static A initInstance() {
		if (instance == null)
			synchronized (B.class) {
				if (instance == null)
					instance = new B();
			}
		return instance;
	}
	public static A getInstance() {
		if (instance == null)
			throw new RuntimeException("EncryptionContext not init");
		return instance;
	}
	public static void main(String[] args) {
		A b = B.initInstance();
		A b2 =B.getInstance();
		System.out.println(b);
	}
}
